package vista;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.LayoutStyle;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.border.LineBorder;
import javax.swing.border.SoftBevelBorder;
import javax.swing.SwingUtilities;

//import controlador.ControladorJFrameOrden;

import java.awt.event.ActionListener;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VistaPrincipal extends javax.swing.JFrame {
	private JPanel jPanelPrincipal;
	private JButton jBtnSalir;
	private JMenu jMenuIngredientes;
	private JMenu jMenuCategoria;
	private JMenu jMenuSalir;
	private JMenu jMenuListadoIngredientes;
	private JMenu jMenuOrden;
	private JMenu jMenuClientes;
	private JMenu jMenuProductos;
	private JMenuBar jMenuBar1;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				VistaPrincipal inst = new VistaPrincipal();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public VistaPrincipal() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
			getContentPane().setLayout(thisLayout);
			this.setTitle("-SGECR- [Menu Principal]-");
			getContentPane().setBackground(new java.awt.Color(93,193,225));
			{
				jMenuBar1 = new JMenuBar();
				setJMenuBar(jMenuBar1);
				jMenuBar1.setBackground(new java.awt.Color(173,216,230));
				{
					jMenuProductos = new JMenu();
					jMenuBar1.add(jMenuProductos);
					jMenuProductos.setText("Productos");
					jMenuProductos.setBorder(BorderFactory.createTitledBorder(""));
					jMenuProductos.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent evt) {
							System.out.println("jMenuProductos.mouseClicked, event="+evt);
							//TODO add your code for jMenuProductos.mouseClicked
							VistaProducto PantallaProductos = new VistaProducto();
							PantallaProductos.setVisible(true);
						}
					});
				}
				{
					jMenuClientes = new JMenu();
					jMenuBar1.add(jMenuClientes);
					jMenuClientes.setText("Clientes");
					jMenuClientes.setBorder(BorderFactory.createTitledBorder(""));
					jMenuClientes.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent evt) {
							System.out.println("jMenuClientes.mouseClicked, event="+evt);
							//TODO add your code for jMenuClientes.mouseClicked
							VistaCliente PantallaClientes = new VistaCliente();
							PantallaClientes.setVisible(true);
						}
					});
				}
				{
					jMenuIngredientes = new JMenu();
					jMenuBar1.add(jMenuIngredientes);
					jMenuIngredientes.setText("Ingredientes");
					jMenuIngredientes.setBorder(BorderFactory.createTitledBorder(""));
					jMenuIngredientes.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent evt) {
							System.out.println("jMenuIngredientes.mouseClicked, event="+evt);
							//TODO add your code for jMenuIngredientes.mouseClicked
							VistaIngrediente PantallaIngredientes = new VistaIngrediente();
							PantallaIngredientes.setVisible(true);
						}
					});
				}
				{
					jMenuCategoria = new JMenu();
					jMenuBar1.add(jMenuCategoria);
					jMenuCategoria.setText("Categoria de Productos");
					jMenuCategoria.setBorder(BorderFactory.createTitledBorder(""));
					jMenuCategoria.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent evt) {
							System.out.println("jMenuCategoria.mouseClicked, event="+evt);
							//TODO add your code for jMenuCategoria.mouseClicked
							VistaCategorias PantallaCategorias = new VistaCategorias();
							PantallaCategorias.setVisible(true);
						}
					});
				}
				{
					jMenuOrden = new JMenu();
					jMenuBar1.add(jMenuOrden);
					jMenuOrden.setText("Ordenes de Servicio");
					jMenuOrden.setBorder(BorderFactory.createTitledBorder(""));
					jMenuOrden.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent evt) {
							System.out.println("jMenuOrden.mouseClicked, event="+evt);
							//TODO add your code for jMenuOrden.mouseClicked
							//ControladorJFrameOrden controladorventanaOrdenes = new ControladorJFrameOrden();
							VistaOrdenes PantallaOrden = new VistaOrdenes();
							PantallaOrden.setVisible(true);
						}
					});
				}
				{
					jMenuListadoIngredientes = new JMenu();
					jMenuBar1.add(jMenuListadoIngredientes);
					jMenuListadoIngredientes.setText("Listado de Ingredientes");
					jMenuListadoIngredientes.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent evt) {
							System.out.println("jMenuListadoIngredientes.mouseClicked, event="+evt);
							VistaListadoIngredientes PantallaListado = new VistaListadoIngredientes();
							PantallaListado.setVisible(true);
						}
					});
					//VistaListadoIngredientes 
				}
				{
					jMenuSalir = new JMenu();
					jMenuBar1.add(jMenuSalir);
					jMenuSalir.setText("Salir");
					jMenuSalir.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent evt) {
							System.out.println("jMenuSalir.mouseClicked, event="+evt);
							//TODO add your code for jMenuOrden.mouseClicked
							System.exit(0);
						}
					});
				}
			}
			{
				jPanelPrincipal = new JPanel();
				GroupLayout jPanelPrincipalLayout = new GroupLayout((JComponent)jPanelPrincipal);
				jPanelPrincipal.setLayout(jPanelPrincipalLayout);
				jPanelPrincipal.setBackground(new java.awt.Color(173,216,230));
				{
					jBtnSalir = new JButton();
					jBtnSalir.setText("Salir");
					/*jBtnSalir.addMouseListener(new MouseAdapter() {
						public void mouseClicked(MouseEvent evt) {
							System.out.println("jBtnSalir.mouseClicked, event="+evt);
							//TODO add your code for jBtnSalir.mouseClicked
							System.exit(0);
						}
					});*/
					
					
				}

					jPanelPrincipalLayout.setHorizontalGroup(jPanelPrincipalLayout.createSequentialGroup()
						.addContainerGap(554, 554)
						.addComponent(jBtnSalir, 0, 164, Short.MAX_VALUE)
						.addContainerGap(35, 35));
					jPanelPrincipalLayout.setVerticalGroup(jPanelPrincipalLayout.createSequentialGroup()
					.addContainerGap(254, 254)
					.addComponent(jBtnSalir, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(44, Short.MAX_VALUE));
			}
			thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
				.addContainerGap(27, 27)
				.addComponent(jPanelPrincipal, GroupLayout.PREFERRED_SIZE, 323, GroupLayout.PREFERRED_SIZE)
				.addContainerGap(66, Short.MAX_VALUE));
			thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
				.addContainerGap(58, 58)
				.addComponent(jPanelPrincipal, GroupLayout.PREFERRED_SIZE, 753, GroupLayout.PREFERRED_SIZE)
				.addContainerGap(57, Short.MAX_VALUE));
			pack();
			this.setSize(878, 475);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	public void addListener(ActionListener actionlistener)
	{
		this.jMenuProductos.addActionListener(actionlistener);
		this.jMenuClientes.addActionListener(actionlistener);
		this.jMenuIngredientes.addActionListener(actionlistener);
		this.jMenuCategoria.addActionListener(actionlistener);
		this.jMenuOrden.addActionListener(actionlistener);
		this.jMenuListadoIngredientes.addActionListener(actionlistener);
		this.jMenuSalir.addActionListener(actionlistener);
		this.jBtnSalir.addActionListener(actionlistener);
	}
	
	public void MostrarMensaje(String mensaje)
	{
		JOptionPane.showMessageDialog(this, mensaje);
	}

}
